<!DOCTYPE html>
<html>

	<head>
		<meta charset=utf-8">
		<title>Registration Form</title>

	</head>


	<body>
		<form method="POST" action="" id="registrationForm" onSubmit="TestForm()" >
			<table>
				<thead>
					<tr>
						<th>
							Account Information
						</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td>
							Username
						</td>
						<td>
							<input type="text" name="username" id="username"/>
						</td>
					</tr>
					<tr>
						<td>
							Password
						</td>
						<td>
							<input type="password" name="userpassword" id="userpassword" />
						</td>
					</tr>
					<tr>
						<td>
							Repeat password
						</td>
						<td>
							<input type="password" name="userpasswordrepeat" id="userpasswordrepeat" />
						</td>
					</tr>
					<tr>
						<td>
							Email
						</td>
						<td>
							<input type="email" name="email" id="email" required="true" />
						</td>
					</tr>
					<tr>
						<td>
							Repeat email
						</td>
						<td>
							<input type="email" name="repeatemail" id="repeatemail" required="true" />
						</td>
					</tr>
					<tr>
						<td>
							URL
						</td>
						<td>
							<input type="url" name="url" id="url" required="true" />
						</td>
					</tr>
				</tbody>
				<tfoot>
					<tr>
						<td>
							<input type="submit" id="submitForm" value="Send" />
					</tr>
				</tfoot>
			</table>
		</form>
	</body>

		<script>
		function TestForm()
		{
			var email = document.registrationForm.email.value;
			var repeatedEmail = document.registrationForm.repeatemail.value;
			if( email == repeatedEmail)
			{
				document.registrationForm.submit();
			}
			else
			{
				alert("The emails you entered do not match!");
				window.location.reload();
			}
		}
		</script>
</html>